home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / EXITKEY.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  51 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   EXITKEY .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. $INCLUDE "DAS-NB01.INC"
  22. COLOR 7, 0
  23. CLS
  24.  
  25. ? "┌───────────────────────────────────────────────────────────────
  26. ? "│ fExitKey%( Exet$, KeyPress% )
  27. ? "├────────────────────────────────────────────────────────────────────
  28. ? "│ This function checks for an <<< EXACT >>> match of KeyPress% in Exet$
  29. ? "└────────────────────────────────────────────────────────────────────────
  30.  
  31. Exet$ = CHR$(013,000,027,000,000,068,000,059)       ' CHR$(000,068) is F-10
  32. '            <enter>  <esc>   <f10>   <f-1>         '
  33.                                                     '
  34. G$    = "D"                                         ' G$ = "D"
  35. ? "IS 'D' IN CHR$(13,0,27,0,0,68,0,59)         ";   '
  36. IF INSTR( Exet$, G$ ) = 0 THEN PRINT "NOT ";        ' this returns "FOUND"
  37.    PRINT "FOUND"                                    ' which is true but G$
  38. PRINT                                               '
  39.                                                     ' is NOT one of the keys
  40.                                                     ' we were looking for!
  41. G%    = CVI( G$+CHR$(0) )                           ' convert to integer
  42. ? "NOW CHECK IF 'D' IS _NOT_ THERE:            ";   '
  43. IF NOT fExitKey%( Exet$, G% ) THEN PRINT "NOT ";    ' Now we get a NOT FOUND
  44.   PRINT "FOUND"                                     '
  45. PRINT                                               '
  46.                                                     '
  47. G% = CVI( CHR$(000,068) )                           ' NOW G% = F10
  48. ? "LOOKING FOR 'F10' IN CHR$(13,27,0,68,0,072) ";   '
  49. IF NOT fExitKey%( Exet$, G% ) THEN PRINT "NOT ";    ' and we get a "FOUND"
  50.   PRINT "FOUND"                                     '
  51.